﻿<%@ Page Title="" Language="C#" MasterPageFile="~/customer/Cliente.Master" AutoEventWireup="true"
    CodeBehind="ListaPedidos.aspx.cs" Inherits="Loja.customer.Pedidos" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="../scripts/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../scripts/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../scripts/jquery-ui-1.8.16.custom/css/custom-theme/jquery-ui-1.8.16.custom.css" />
    <script src="../scripts/uteis.js" type="text/javascript"></script>
    <style>
        .texto
        {
            font-family: "Verdana" , "Lucida Sans Unicode" , "Lucida Grande" , Sans-Serif;
            font-size: 12px;
            font-weight: bold;
            color: #A94513;
            padding-right: 10px;
            margin-left: 20px;
        }
        .data
        {
            width: 60pt;
        }
        a:hover
        {
            text-decoration:underline;
            }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>
        Pedidos</h1>
    <table style="width: 780px; margin-left: 40px; margin-bottom: 25px" title="Pedidos">
        <tr>
            <td>
                <fieldset>
                    <legend class="labelCadastro">Pedidos feitos</legend>
                    <table>
                        <tr>
                            <td>
                                <span class="texto">De:</span><asp:TextBox ID="txtDatIni" runat="server" CssClass="data"></asp:TextBox>
                            </td>
                            <td>
                                <span class="texto">Até:</span><asp:TextBox ID="txtDatFim" runat="server" CssClass="data"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
            <td>
                <fieldset>
                    <legend class="labelCadastro">Situação</legend>
                    <table style="padding: 0 0 0 15px">
                        <tr>
                            <td>
                                <div id="radio">
                                    <asp:RadioButton ID="rdbEntregues" runat="server" Text="Entregues" GroupName="Situacao" />
                                    <asp:RadioButton ID="rdbNaoEntregue" runat="server" Text="À Entregar" GroupName="Situacao" />
                                    <asp:RadioButton ID="rdfTodos" runat="server" Text="Todos" GroupName="Situacao" />
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
            <td>
                <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar" CssClass="botao" 
                    onclick="btnPesquisar_Click" />
            </td>
        </tr>
    </table>
    <table id="tabela" style="float: left; clear: both; width: 780px">
        <thead class="cabecalho">
            <tr>
                <th scope="col" colspan="1">
                    <strong>Pedido</strong>
                </th>
                <th scope="col" colspan="1">
                    <strong>Data do Pedido</strong>
                </th>
                <th scope="col" colspan="1">
                    <strong>Valor total</strong>
                </th>
                <th scope="col" colspan="1">
                    <strong>Data da Entrega</strong>
                </th>
            </tr>
        </thead>
        <tbody>
            <asp:Repeater ID="rptPedidos" runat="server">
                <ItemTemplate>
                    <tr class="tblLinha">
                        <td>
                            <a href="<%# Page.ResolveUrl("~/../loja/customer/") + "showpedido.aspx?order=" +  DataBinder.Eval(Container.DataItem, "PedNum") %>" ><%# String.Format("{0:0000000}",DataBinder.Eval(Container.DataItem, "PedNum"))%></a>
                        </td>
                        <td>
                            <%# String.Format("{0:d}",DataBinder.Eval(Container.DataItem, "PedDat") )%>
                        </td>
                        <td>
                            <%# String.Format("{0:c}",DataBinder.Eval(Container.DataItem, "PedValEnt")) %>
                        </td>
                        <td>
                            <%#String.Format("{0:d}", DataBinder.Eval(Container.DataItem, "PedDatEnt")) %>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </tbody>
    </table>
</asp:Content>
